package com.turing.post.account.util;

import javax.ejb.Local;
import javax.ejb.Remote;

import com.turing.post.cardmanagement.util.ApduExecuteObj;
import com.turing.post.cardmanagement.util.AppManagement;
import com.turing.post.cardmanagement.util.AppZoneInf;
import com.turing.post.util.PCPSApplicationException;
import com.turing.post.util.PCPSWebInput;

@Remote
@Local
public interface OnlineLoadDetailBusiness {

	/**
	 * 读卡应用初始化
	 * 
	 * @param webInput
	 * @param am
	 * @return
	 * @throws PCPSApplicationException
	 */
	public ApduExecuteObj generateReadAppZoneApdu(PCPSWebInput webInput,
			AppManagement am) throws PCPSApplicationException;

	/**
	 * 解析读卡应用初始化
	 * 
	 * @param webInput
	 * @param am
	 * @param aeo
	 * @return
	 * @throws PCPSApplicationException
	 */
	public AppZoneInf parseAppZoneObject(PCPSWebInput webInput,
			AppManagement am, ApduExecuteObj aeo)
			throws PCPSApplicationException;

	/**
	 * 将指定应用特定的对象进行HTML渲染,以驱动客户端展现
	 * 
	 * @param am
	 * @param appObj
	 * @return
	 * @throws PCPSApplicationException
	 */
	public String renderAppZoneObject(PCPSWebInput webInput, AppManagement am,
			AppZoneInf appObj) throws PCPSApplicationException;

	/**
	 * 圈存初始化指令:圈存前验证,并记流水
	 * 
	 * @param webinput
	 * @param chkObj
	 * @throws PCPSApplicationException
	 */
	public ApduExecuteObj checkOnlineLoad(PCPSWebInput webInput,
			OnlineLoadDetail chkObj, AppZoneInf appObj)
			throws PCPSApplicationException;

	/**
	 * 解析圈存初始化结果,已记账
	 * 
	 * @param webinput
	 * @param initObj
	 * @throws PCPSApplicationException
	 */
	public ApduExecuteObj initOnlineLoad(PCPSWebInput webInput,
			OnlineLoadDetail initObj, ApduExecuteObj aeo)
			throws PCPSApplicationException;

	/**
	 * 解析圈存结果
	 * 
	 * @param webInput
	 * @param initObj
	 * @param aeo
	 * @throws PCPSApplicationException
	 */
	public void resolveLoadResult(PCPSWebInput webInput, String loadSeqNo,
			ApduExecuteObj aeo) throws PCPSApplicationException;

	/**
	 * 更新流水状态
	 * 
	 * @param webInput
	 * @param LoadSeqNo
	 * @param status
	 * @throws PCPSApplicationException
	 */
	public void changeOnlineLoadStatus(PCPSWebInput webInput, String loadSeqNo,
			String status) throws PCPSApplicationException;

	/**
	 * 手工调整圈存
	 * 
	 * @param webInput
	 * @param initObj
	 * @throws PCPSApplicationException
	 */
	public void adjustOnlineLoad(PCPSWebInput webInput, OnlineLoadDetail initObj)
			throws PCPSApplicationException;

	/**
	 * 记本地圈存流水
	 * 
	 * @param loadObj
	 * @throws PCPSApplicationException
	 */
	public void insertOnlineLoadDetail(OnlineLoadDetail loadObj)
			throws PCPSApplicationException;

}
